<DynamicPageBanner title="{intl.mutedUsers}" icon="#fa-volume-off" />
{#if $isUserLoggedIn }
  <AccountsListPage {accountsFetcher} {accountActions} />
{/if}
<script>
  import AccountsListPage from '../_components/AccountsListPage.html'
  import { store } from '../_store/store.js'
  import { getMutedAccounts } from '../_api/blockedAndMuted.js'
  import DynamicPageBanner from '../_components/DynamicPageBanner.html'
  import { setAccountMuted } from '../_actions/mute.js'

  export default {
    data: () => ({
      accountActions: [
        {
          icon: '#fa-volume-up',
          label: 'intl.unmute',
          onclick: (accountId) => setAccountMuted(accountId,
            /* mute */ false,
            /* notifications */ false,
            /* toastOnSuccess */ true)
        }
      ]
    }),
    computed: {
      accountsFetcher: ({ $currentInstance, $accessToken }) => () => getMutedAccounts($currentInstance, $accessToken)
    },
    store: () => store,
    components: {
      AccountsListPage,
      DynamicPageBanner
    }
  }
</script>
